package com.xzx.exception;

import com.xzx.enu.ErrorCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 *
 * @author xinzhixuan
 * @version 1.0
 * @date 2025/8/22 15:59
 */
public class RestRuntimeException extends RuntimeException {
    private final ErrorCode errorCode;

    public RestRuntimeException(ErrorCode errorCode) {
        super(errorCode.getMessage());
        this.errorCode = errorCode;
    }

    public String getMessage() {
        return errorCode.getMessage();
    }

    public String getCode() {
        return errorCode.getCode();
    }
}
